/*
 * @Author: 刘经标 2604132672@qq.com
 * @Date: 2025-04-12 17:43:33
 * @LastEditors: 刘经标 2604132672@qq.com
 * @LastEditTime: 2025-04-14 11:43:52
 * @FilePath: /ai-backend/src/config/env.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import dotenv from 'dotenv';
import path from 'path';
import { fileURLToPath } from 'url';

const __dirname = path.dirname(fileURLToPath(import.meta.url));

dotenv.config({
  path: path.resolve(__dirname, '../../.env')
});

export const config = {
  PORT: parseInt(process.env.PORT || '3000'),
  DEEPSEEK_API_KEY: process.env.DEEPSEEK_API_KEY!,
  NODE_ENV: process.env.NODE_ENV || 'development'
};

// 验证必需变量
if (!config.DEEPSEEK_API_KEY) {
  throw new Error('Missing DEEPSEEK_API_KEY in .env');
}